﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="tananyagKezeles.aspx.cs" Inherits="NEMProjectWebApp.Pages.Oktato.tananyagKezeles" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <center>
        <table width="*">
            <tr>
                <td class="Righty">
                    Tárgyak:
                </td>
                <td class="Lefty">
                    <asp:DropDownList ID="TargyakDropDownList" runat="server" Width="258px" Height="16px"
                        AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="TargyNeve" DataValueField="T_ID"
                        OnSelectedIndexChanged="TargyakDropDownList_SelectedIndexChanged">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:masterConnectionString %>"
                        SelectCommand="SELECT Targy.T_ID, Targy.TargyNeve FROM Targy INNER JOIN UserTargyKapcs ON Targy.T_ID = UserTargyKapcs.Targy_ID WHERE (UserTargyKapcs.User_ID = @ID)"
                        OnSelecting="SqlDataSource1_Selecting">
                        <SelectParameters>
                            <asp:SessionParameter DefaultValue="0" Name="ID" SessionField="User_ID" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td>
                    Feltöltendő tananyag:
                </td>
                <td>
                    <asp:FileUpload ID="FileUpload1" runat="server" Width="255px" />
                </td>
            </tr>
            <tr>
                <td class="Lefty" colspan="2">
                    <p>
                        Adott tárgy anyagai:<br />
                        <asp:ListBox ID="AnyagListBox" runat="server" Width="400px" DataSourceID="SqlDataSource2"
                            DataTextField="FileName" DataValueField="Tan_ID"></asp:ListBox>
                        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:masterConnectionString %>"
                            SelectCommand="SELECT Tananyag.FileName, TananyagKapcs.Tan_ID FROM TananyagKapcs INNER JOIN Tananyag ON TananyagKapcs.Tan_ID = Tananyag.Tan_ID WHERE (TananyagKapcs.Targy_ID = @Targy_ID)">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="TargyakDropDownList" DefaultValue="0" Name="Targy_ID"
                                    PropertyName="SelectedValue" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </p>
                </td>
            </tr>
            <tr class="Center">
                <td>
                    <asp:Button ID="torolButton" runat="server" Text="Törlés" OnClick="torolButton_Click"
                        UseSubmitBehavior="False" />
                </td>
                <td>
                    <asp:Button ID="feltoltButton" runat="server" Text="Feltölt" OnClick="feltoltButton_Click"
                        UseSubmitBehavior="False" />
                </td>
            </tr>
        </table>
    </center>
</asp:Content>
